﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Media;

namespace Game_Fly.GameSound
{
    /// <summary>
    /// 游戏音乐类
    /// </summary>
    class GameSound
    {
        //游戏背景音乐
        private static SoundPlayer backSoundPlayer;
        static GameSound()
        {
            backSoundPlayer = new SoundPlayer();
        }
        /// <summary>
        /// 启动背景音乐
        /// </summary>
        /// <param name="sound">表示要播放的音乐</param>
        public static void BackSoundPlay(Stream sound)
        {
            
            backSoundPlayer.Stream = sound;
            backSoundPlayer.PlayLooping();
        }
        /// <summary>
        /// 停止背景音乐
        /// </summary>
        public static void BackSoundStop()
        {
            backSoundPlayer.Stop();
        }
    }
}
